

package com.hazelcast.internal.longregister.operations;

import com.hazelcast.internal.longregister.LongRegister;
import com.hazelcast.spi.impl.operationservice.ReadonlyOperation;

import static com.hazelcast.internal.longregister.LongRegisterDataSerializerHook.GET;

public class GetOperation extends AbstractLongRegisterOperation implements ReadonlyOperation {

    private long returnValue;

    public GetOperation() {
    }

    public GetOperation(String name) {
        super(name);
    }

    @Override
    public void run() throws Exception {
        LongRegister container = getLongContainer();
        returnValue = container.get();
    }

    @Override
    public Object getResponse() {
        return returnValue;
    }

    @Override
    public int getClassId() {
        return GET;
    }
}
